import { bqz } from '../servers/api'

function useGetImages(setImages) {
    let imagesResult = []
    useEffect(() => {
        async function getImages() {
            const { data } = await axios.get(bqz.trends)
            data.data.objectList.forEach(list => {
                imagesResult = imagesResult.concat(list?.object?.images)
            })
            setImages(imagesResult)
        }
        getImages()
    }, [setImages]);
    return imagesResult
}

export default useGetImages